<?php

namespace App\Models\Income;

use App\Models\Model;

class IncomeCash extends Model
{
    protected $table = 'akbus_income_cash';

    protected $fillable = [
        'date',
        'license_plate_num',
        'cash_income',
    ];

    /**
     * 拼接车牌号字符
     *
     * @param  string  $value
     *
     * @return string
     */
    public function getLicensePlateNumAttribute($value)
    {
        return '陕G'.$value;
    }

    /**
     * 空数据显示为0
     *
     * @param $value
     *
     * @return mixed
     */
    public function getCashIncomeAttribute($value)
    {
        return $value ?: 0;
    }
}
